package com.mingqijia.gassafety.shared.constant;

import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Date;

/**
 * @author zhangfei
 * @version 1.0.0
 * @ClassName DtuPushTypeEnum.java
 * @Description TODO
 * @createTime 2023年12月18日
 */
@Getter
@RequiredArgsConstructor
public enum DtuPushTypeEnum {

    // 推送时间段: 0即刻、1短白天、2长白天、3上午、4下午、5晚上
    PUSH_0(0, "即刻", new String[]{},new Integer[]{}),
    PUSH_1(1, "短白天", new String[]{" 08:00","18:00"},new Integer[]{8,18}),
    PUSH_2(2, "长白天", new String[]{" 08:00","22:00"},new Integer[]{8,22}),
    PUSH_3(3, "上午", new String[]{" 08:00","12:00"},new Integer[]{8,12}),
    PUSH_4(4, "下午", new String[]{" 12:00","18:00"},new Integer[]{12,18}),
    PUSH_5(5, "晚上", new String[]{" 18:00","20:00"},new Integer[]{18,20});


    private final int code;
    private final String name;
    private final String[] types;
    private final Integer[] integers;


    public static  DtuPushTypeEnum getPushTypes(int code) {
        for (DtuPushTypeEnum dtuPushTypeEnum : DtuPushTypeEnum.values()) {
            if (dtuPushTypeEnum.getCode()==(code)) return dtuPushTypeEnum;
        }
        return null;
    }

    public static void main(String[] args) {
        DtuPushTypeEnum pushTypes = DtuPushTypeEnum.getPushTypes(0);
        String[] types = pushTypes.getTypes();
        String type = types[0];
        System.out.println(type);

    }
}
